package br.com.lopes.gci.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Dominio entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "dominio", catalog = "gcibd")
public class Dominio implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2216915576382814739L;
	// Fields
	@Id
	@Column(name = "codigo", unique = true, nullable = false)
	private Integer codigo;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "status")
	private Dominio status;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "constraint_codigo")
	private Constraint constraint;
	
	@Column(name = "nome", length = 50)
	private String nome;
	
	@Column(name = "descricao", length = 70)
	private String descricao;
	
	

	// Constructors

	/** default constructor */
	public Dominio() {
	}

	/** minimal constructor */
	public Dominio(Integer codigo) {
		this.codigo = codigo;
	}

	/** full constructor */
	public Dominio(Integer codigo, Dominio status, Constraint constraint,
			String nome, String descricao) {
		this.codigo = codigo;
		this.status = status;
		this.constraint = constraint;
		this.nome = nome;
		this.descricao = descricao;
		
	}

	/**
	 * @return the codigo
	 */
	public Integer getCodigo() {
		return codigo;
	}

	/**
	 * @return the status
	 */
	public Dominio getDominio() {
		return status;
	}

	/**
	 * @return the constraint
	 */
	public Constraint getConstraint() {
		return constraint;
	}

	/**
	 * @return the nome
	 */
	public String getNome() {
		return nome;
	}

	/**
	 * @return the descricao
	 */
	public String getDescricao() {
		return descricao;
	}

	/**
	 * @param codigo the codigo to set
	 */
	public void setCodigo(Integer codigo) {
		this.codigo = codigo;
	}

	/**
	 * @param status the status to set
	 */
	public void setDominio(Dominio status) {
		this.status = status;
	}

	/**
	 * @param constraint the constraint to set
	 */
	public void setConstraint(Constraint constraint) {
		this.constraint = constraint;
	}

	/**
	 * @param nome the nome to set
	 */
	public void setNome(String nome) {
		this.nome = nome;
	}

	/**
	 * @param descricao the descricao to set
	 */
	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

}